package com.ssyt.store.sys.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.ssyt.store.sys.dao.StoreOrderProductDao;
import com.ssyt.store.sys.entity.StoreOrderProduct;
import com.ssyt.store.sys.service.StoreOrderProductService;

@Service
public class StoreOrderProductServiceImpl implements StoreOrderProductService {
	
	@Autowired
	private StoreOrderProductDao storeOrderProductDao;
	
	@Override
	public List<StoreOrderProduct> list(String userId) {
		return null;
	}

	@Override
	public String addStoreOrderProduct(List<StoreOrderProduct> products, String userId) {
		StringBuffer ids = new StringBuffer();
		for (StoreOrderProduct storeOrderProduct : products) {
			String id = storeOrderProductDao.addStoreOrderProduct(storeOrderProduct, userId);
			ids.append(id + ",");
		}
		return ids.toString();
	}

	@Override
	public StoreOrderProduct getStoreOrderProduct(String id) {
		return storeOrderProductDao.getStoreOrderProduct(id);
	}

}
